package com.gj.utli;

import lombok.Data;

/**
 * Created by Hasee on 2019/11/7.
 */
@Data
public class ResultBuilderVo<T> {
    public static<T> ResultVo success(T data){
        ResultVo resultVo = new ResultVo<>();
        resultVo.setData(data);
        resultVo.setSuccess(true);
        return resultVo;
    }
    public static<T> ResultVo success(){
        ResultVo resultVo = new ResultVo<>();
        resultVo.setData(null);
        resultVo.setSuccess(true);
        return resultVo;
    }
    public static ResultVo error(String errorMessage){
        ResultVo resultVo = new ResultVo<>();
        resultVo.setErrorMessage(errorMessage);
        resultVo.setSuccess(false);
        return resultVo;
    }
}
